/**
 * package Default;
 *

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.GridLayout;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.text.NumberFormat;

import javax.swing.BorderFactory;
import javax.swing.JFormattedTextField;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;


public class Environment {
	Manager manager=null;
	static int num_of_agents;
	static int gridSizeX;
	static int gridSizeY;
	static int [][]grid;
	int gridZoom;
	
	public Environment(Manager _manager,int x,int y,int num,int zoom)
	{
		manager=_manager;
		//gridSizeX=x;
		//gridSizeY=y;
		//num_of_agents=num;
		//gridZoom=zoom;
		//grid = new int[y][x];
		//setDetails();
		
	}
	
	/*public void setDetails()
	{
		JFrame frame=new JFrame();
		Details panel=new Details();
		frame.add(panel);
		frame.pack();
		frame.setVisible(true);
		

	}

	/*public class Details extends JPanel implements PropertyChangeListener {
		//Values for the fields
	    private int numOfSensors = 100;
	    private int sizeX = 200;  //7.5%
	    private int sizeY = 100;
	    private int zoom = 4;

	    //Labels to identify the fields
	    private JLabel numOfSensorsLabel;
	    private JLabel sizeXLabel;
	    private JLabel sizeYLabel;
	    private JLabel zoomLabel;

	    //Strings for the labels
	    //private String amountString1 = "Loan Amount: ";
	    //private String rateString1 = "APR (%): ";
	    //private String numPeriodsString1 = "Years: ";
	    //private String paymentString1 = "Monthly Payment: ";

	    //Fields for data entry
	    private JFormattedTextField numOfSensorsField;
	    private JFormattedTextField xField;
	    private JFormattedTextField yField;
	    private JFormattedTextField zoomField;

	    //Formats to format and parse numbers
	    private NumberFormat numberFormat;
	    private NumberFormat xFormat;
	    private NumberFormat yFormat;
	    private NumberFormat zoomFormat;

	public Details() {
        super(new BorderLayout());
        setUpFormats();
        double payment = 0.0;//computePayment(amount,
                              //          rate,
                                //        numPeriods);

        //Create the labels.
        numOfSensorsLabel = new JLabel("Number of sensors ");
        sizeXLabel = new JLabel("X size");
        sizeYLabel = new JLabel("Y size");
        zoomLabel = new JLabel("Zoom");

        //Create the text fields and set them up.
        numOfSensorsField = new JFormattedTextField(numberFormat);
        numOfSensorsField.setValue(new Double(numOfSensors));
        numOfSensorsField.setColumns(10);
        numOfSensorsField.addPropertyChangeListener("value", this);

        xField = new JFormattedTextField(xFormat);
        xField.setValue(new Double(sizeX));
        xField.setColumns(10);
        xField.addPropertyChangeListener("value", this);

        yField = new JFormattedTextField();
        yField.setValue(new Integer(sizeY));
        yField.setColumns(10);
        yField.addPropertyChangeListener("value", this);

        zoomField = new JFormattedTextField(yFormat);
        zoomField.setValue(new Double(payment));
        zoomField.setColumns(10);
        zoomField.addPropertyChangeListener("value", this);
        


        //Tell accessibility tools about label/textfield pairs.
        numOfSensorsLabel.setLabelFor(numOfSensorsField);
        sizeXLabel.setLabelFor(xField);
        sizeYLabel.setLabelFor(yField);
        zoomLabel.setLabelFor(zoomField);

        //Lay out the labels in a panel.
        JPanel labelPane = new JPanel(new GridLayout(0,1));
        labelPane.add(numOfSensorsLabel);
        labelPane.add(sizeXLabel);
        labelPane.add(sizeYLabel);
        labelPane.add(zoomLabel);

        //Layout the text fields in a panel.
        JPanel fieldPane = new JPanel(new GridLayout(0,1));
        fieldPane.add(numOfSensorsField);
        fieldPane.add(xField);
        fieldPane.add(yField);
        fieldPane.add(zoomField);

        //Put the panels in this panel, labels on left,
        //text fields on right.
        setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
        add(labelPane, BorderLayout.CENTER);
        add(fieldPane, BorderLayout.LINE_END);
    }
	public void propertyChange(PropertyChangeEvent e) {
        Object source = e.getSource();
        if (source == numOfSensorsField) {
            numOfSensors = ((Number)numOfSensorsField.getValue()).intValue();
            num_of_agents=numOfSensors;
        } else if (source == xField) {
            sizeX = ((Number)xField.getValue()).intValue();
            gridSizeX=sizeX;
        } else if (source == yField) {
            sizeY = ((Number)yField.getValue()).intValue();       
            gridSizeY=sizeY;
		} else if (source == zoomField) {
	        zoom = ((Number)zoomField.getValue()).intValue();
	        gridZoom=zoom; 
	    }
        double payment = numOfSensors+4;//computePayment(amount, rate, numPeriods);
        zoomField.setValue(new Double(payment));
        //manager.frame.repaint();
    }
	private void setUpFormats() {
        numberFormat = NumberFormat.getNumberInstance();

        xFormat = NumberFormat.getNumberInstance();
        yFormat = NumberFormat.getNumberInstance();
        //yFormat.setMinimumFractionDigits(3);

        zoomFormat = NumberFormat.getCurrencyInstance();
    }

	}
}
*/
